Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: support sqlalchemy 2.x and flask-sqlalchemy 3 (breaking) #2241

Open
wants to merge 30 commits into
base: master
Choose a base branch
from

Conversation

dpgaspar
Copy link
Owner

@dpgaspar dpgaspar commented May 16, 2024

Description

  • Added config option to not create FAB's tables FAB_CREATE_DB
  • Flask-SQLAlchemy singleton is now created by FAB, import from from flask_appbuilder.extensions import db. This means init now is simpler: appbuilder.init_app(app)
  • appbuilder.sm.get_session was renamed to appbuilder.sm.session
  • Doing queries now require an app_context (breaking from flask-sqlalchemy)
  • SQLAInterface will not swallow exceptions, and accepts an optional parameter to commit or not commit
  • appbuilder.get_app does not exist anymore, use current_app instead, you can still use appbuilder.app but it's deprecated

ADDITIONAL INFORMATION

  • Has associated issue:
  • Is CRUD MVC related.
  • Is Auth, RBAC security related.
  • Changes the security db schema.
  • Introduces new feature
  • Removes existing feature

@hasansezertasan
Copy link

Related: #2240

@ddorian
Copy link

ddorian commented May 21, 2024

Also related #2038 #2162 #2108 #1940

@dpgaspar dpgaspar marked this pull request as ready for review June 4, 2024 06:16
@dpgaspar dpgaspar changed the title chore: support sqlalchemy 2.x and flask-sqlalchemy 3 chore: support sqlalchemy 2.x and flask-sqlalchemy 3 (breaking) Jun 4, 2024
@jnahmias
Copy link
Contributor

@dpgaspar thank you so much for working on this! I plan on running some tests on this and will report back.
What sort of reviews are you waiting on prior to merging this?

@veinkr
Copy link

veinkr commented Jul 21, 2024

Hi, @dpgaspar , just curious if there are any new process to upgrade to flask-sqlalchemy>3.0?

@@ -94,7 +95,6 @@ class AppBuilder:
def __init__(
self,
app: Optional[Flask] = None,
session: Optional[SessionBase] = None,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

session was removed from arguments but need to be removed from docstring too

@zacqed
Copy link

zacqed commented Oct 12, 2024

@dpgaspar Is this PR ready for merge and release?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants